from tools_algorithm import *


class Solution:
    def returnToBoundaryCount(self, nums: List[int]) -> int:
        t = ans = 0
        for num in nums:
            t += num
            if t == 0:
                ans += 1
        return ans
